//
// Created by 张玭 on 24-6-14.
//
# include "iostream"

using namespace std;

// 全局变量
int g_a = 10;
int g_b = 10;

//const修饰的变量
const int c_a = 10;

int main() {
    // 局部变量
    int a = 10;
    int b = 10;

    //静态变量
    static int s_a = 10;
    static int s_b = 10;

    //常量

    //字符串常量


    cout << "局部变量a、b的地址" << endl;
    cout << "a的地址为：" << (long) &a << endl;
    cout << "b的地址为：" << (long) &b << endl;

    cout << "全局变量g_a、g_b的地址" << endl;
    cout << "g_a的地址为：" << (long) &g_a << endl;
    cout << "g_b的地址为：" << (long) &g_b << endl;

    cout << "静态变量s_a、s_b的地址" << endl;
    cout << "s_a的地址为：" << (long) &s_a << endl;
    cout << "s_b的地址为：" << (long) &s_b << endl;

    cout << "常量的地址为" << endl;
    cout << "常量c_a的地址为：" << (long) &c_a << endl;
    cout << "字符串常量的地址为：" << (long) &"hello world" << endl;


}